$().ready(function () {
    layui.use('element', function () {
        var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块

        //监听导航点击
        element.on('nav(demo)', function (elem) {
            //console.log(elem)
            layer.msg(elem.text());
        });
    });
    layui.use(['carousel'], function () {
        var carousel = layui.carousel
        carousel.render({
            elem: '#test10'
            , width: '100%'
            , height: '440px'
            , interval: 5000
        });
    });
    $.ajax({
        type: "post",
        url:'/index/ListLive/ListsInfo',
        dataType: "json",
        data: {
            'access_token':$.cookie('access_token')
        },
        success: function (data) {
            html ='';
            $.each(data.data,function (index,list) {
                html = html + '<li data-tid="'+list.id+'">' +
                    '        <a href="/index/info/index?id='+list.id+'">' +
                    '            <div class="pic">' +
                    '                <img src="/application/index/static/live_img/'+list.live_img+'"' +
                    '                     style="display: block;">' +
                    '                <span><b></b></span>' +
                    '            </div>' +
                    '            <div class="txt">'+list.name+'<img src="/application/index/static/index/img/3.png" class="icon" alt="">2</div>' +
                    '        </a>' +
                    '    </li>'
            });
            $('.list-ul').append(html);
        }
    })
})